package bao;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class CountBao {
	public Integer find(){
		Integer count=null;
		String spl="select * from countBao";
		Connection coun = coumic.getConnection();
		try {
			Statement sun = coun.createStatement();
			ResultSet str = sun.executeQuery(spl);
			while(str.next()){
				count=str.getInt(1);
			}
			sun.close();
			str.close();
			coun.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return count;
	}
	
	
	public void finde(Integer sun){
		String spl="update countbao set count="+sun;
		Connection conn = coumic.getConnection();
		Statement state;
		try {
			state = conn.createStatement();
			state.execute(spl);
			state.close();
			conn.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
}
